﻿
@model KRM.Core.tblOrder
@{
    ViewBag.Title = "Update customer detail";
    Layout = "~/Views/Shared/_PopupLayout.cshtml";
    var shipping = Model.ShippingAddress;
    var billing = Model.BillingAddress;
}

<form action="/orderview/updatedetail" method="POST">
    <div style="padding: 0 15px">
        @Html.Partial("Partial/_MessageResult")
        <div class="row-fluid">
            <fieldset class="span6">
                <legend>Shipping details</legend>
                <input type="hidden" name="OrderAddressID" value="@(shipping != null ? shipping.OrderAddressID : 0)"/>
                <input type="hidden" name="orderref" value="@Model.OrderRef">
                <input type="hidden" name="orderid" value="@Model.OrderID">
                <div class="row-fluid">
                    <div class="span3">
                        Title
                    </div>
                    <div class="span9">
                        <select class="span5" name="title">
                            <option>Mr</option>
                            <option>Mrs</option>
                            <option>Ms</option>
                            <option>Miss</option>
                            <option>Dr</option>
                            <option>Rev</option>
                        </select>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                        Name
                    </div>
                    <div class="span9 row-fluid">
                        <div class="span6">
                            <input type="text" style="width: 91%" name="FirstName" value="@(shipping != null ? shipping.FirstName : "")" />
                        </div>
                        <div class="span6">
                            <input type="text" style="width: 91%" name="Surname" value="@(shipping != null ? shipping.Surname : "")"/>
                        </div>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                        Address
                    </div>
                    <div class="span9">
                        <input type="text" style="width: 96%" name="AddressLine1" value="@(shipping != null ? shipping.AddressLine1 : "")" />
                        <textarea style="width: 96%" name="AddressLine2">@(shipping != null ? shipping.AddressLine2 : "")</textarea>
                        <input type="text" style="width: 96%" name="Town" value="@(shipping != null ? shipping.Town : "")" />
                        <div class="row-fluid">
                            <div class="span6">
                                <input type="text" style="width: 91%" name="County" value="@(shipping != null ? shipping.County : "")"/>
                            </div>
                            <div class="span6">
                                <input type="text" style="width: 91%" name="Postcode" value="@(shipping != null ? shipping.Postcode : "")"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                        Phone
                    </div>
                    <div class="span9">
                        <input type="text" style="width: 96%" name="Telephone1" value="@(shipping != null ? shipping.Telephone1 : "")"/>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                        Phone 2
                    </div>
                    <div class="span9">
                        <input type="text" style="width: 96%" name="Telephone2" value="@(shipping != null ? shipping.Telephone2 : "")"/>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                        Mobile
                    </div>
                    <div class="span9">
                        <input type="text" style="width: 96%" name="Mobile" value="@(shipping != null ? shipping.Mobile : "")"/>
                    </div>
                </div>
            </fieldset>
            <fieldset class="span6">
                <legend>Billing details</legend>
                <input type="hidden" name="b_OrderAddressID" value="@(billing != null ? billing.OrderAddressID : 0)"/>
                <div class="row-fluid">
                    <div class="span3">
                        Title
                    </div>
                    <div class="span9">
                        <select class="span5" name="b_title">
                            <option>Mr</option>
                            <option>Mrs</option>
                            <option>Ms</option>
                            <option>Miss</option>
                            <option>Dr</option>
                            <option>Rev</option>
                        </select>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                        Name
                    </div>
                    <div class="span9 row-fluid">
                        <div class="span6">
                            <input type="text" style="width: 91%" name="b_FirstName" value="@(billing != null ? billing.FirstName : "")" /></div>
                        <div class="span6">
                            <input type="text" style="width: 91%" name="b_Surname" value="@(billing != null ? billing.Surname : "")"/></div>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                        Address
                    </div>
                    <div class="span9">
                        <input type="text" style="width: 96%" name="b_AddressLine1" value="@(billing != null ? billing.AddressLine1 : "")" />
                        <textarea style="width: 96%" name="b_AddressLine2">@(billing != null ? billing.AddressLine2 : "")</textarea>
                        <input type="text" style="width: 96%" name="b_Town" value="@(billing != null ? billing.Town : "")" />
                        <div class="row-fluid">
                            <div class="span6">
                                <input type="text" style="width: 91%" name="b_County" value="@(billing != null ? billing.County : "")"/></div>
                            <div class="span6">
                                <input type="text" style="width: 91%" name="b_Postcode" value="@(billing != null ? billing.Postcode : "")"/></div>
                        </div>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                        Phone
                    </div>
                    <div class="span9">
                        <input type="text" style="width: 96%" name="b_Telephone1" value="@(billing != null ? billing.Telephone1 : "")"/>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                        Phone 2
                    </div>
                    <div class="span9">
                        <input type="text" style="width: 96%" name="b_Telephone2" value="@(billing != null ? billing.Telephone2 : "")"/>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                        Mobile
                    </div>
                    <div class="span9">
                        <input type="text" style="width: 96%" name="b_Mobile" value="@(billing != null ? billing.Mobile : "")"/>
                    </div>
                </div>
            </fieldset>
            <div class="row-fluid">
                <div class="span5">
                    Email
                        <input type="email" name="Email" value="@ViewBag.Email" />
                </div>
                <div class="span6 text-right">
                    <button class="btn btn-primary" type="submit">Update</button>
                </div>
            </div>
        </div>
    </div>
</form>
